<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>HexFiend: HFByteArray(HFFileWriting) Category Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">HexFiend
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Instance Methods</a> &#124;
<a href="category_h_f_byte_array_07_h_f_file_writing_08-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">HFByteArray(HFFileWriting) Category Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><a class="el" href="interface_h_f_byte_array.html" title="The principal Model class for HexFiend&#39;s MVC architecture. ">HFByteArray</a> methods for writing to files, and preparing other HFByteArrays for potentially destructive file writes.  
</p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Instance Methods</h2></td></tr>
<tr class="memitem:a9be82f7cd32f941cc94d1843ad9ad5e8"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="category_h_f_byte_array_07_h_f_file_writing_08.html#a9be82f7cd32f941cc94d1843ad9ad5e8">writeToFile:trackingProgress:error:</a></td></tr>
<tr class="separator:a9be82f7cd32f941cc94d1843ad9ad5e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a44e1ab1943523b12bfd2e423ec87274a"><td class="memItemLeft" align="right" valign="top">(NSArray *)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="category_h_f_byte_array_07_h_f_file_writing_08.html#a44e1ab1943523b12bfd2e423ec87274a">rangesOfFileModifiedIfSavedToFile:</a></td></tr>
<tr class="separator:a44e1ab1943523b12bfd2e423ec87274a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7ea74a3d609086f0ece0998ff96947e9"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="category_h_f_byte_array_07_h_f_file_writing_08.html#a7ea74a3d609086f0ece0998ff96947e9">clearDependenciesOnRanges:inFile:hint:</a></td></tr>
<tr class="separator:a7ea74a3d609086f0ece0998ff96947e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Method Documentation</h2>
<a id="a9be82f7cd32f941cc94d1843ad9ad5e8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9be82f7cd32f941cc94d1843ad9ad5e8">&sect;&nbsp;</a></span>writeToFile:trackingProgress:error:()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (BOOL) writeToFile: </td>
          <td></td>
          <td class="paramtype">(NSURL *)&#160;</td>
          <td class="paramname"><em>targetURL</em></td>
        </tr>
        <tr>
          <td class="paramkey">trackingProgress:</td>
          <td></td>
          <td class="paramtype">(<a class="el" href="interface_h_f_progress_tracker.html">HFProgressTracker</a> *)&#160;</td>
          <td class="paramname"><em>progressTracker</em></td>
        </tr>
        <tr>
          <td class="paramkey">error:</td>
          <td></td>
          <td class="paramtype">(NSError **)&#160;</td>
          <td class="paramname"><em>error</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Attempts to write the receiver to a file. This is a concrete method on <a class="el" href="interface_h_f_byte_array.html" title="The principal Model class for HexFiend&#39;s MVC architecture. ">HFByteArray</a>. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">targetURL</td><td>A URL to the file to be written to. It is OK for the receiver to contain one or more instances of <a class="el" href="interface_h_f_byte_slice.html" title="A class representing a source of data for an HFByteArray. ">HFByteSlice</a> that are sourced from the file. </td></tr>
    <tr><td class="paramname">progressTracker</td><td>An <a class="el" href="interface_h_f_progress_tracker.html" title="A class that helps handle progress indication and cancellation for long running threaded operations...">HFProgressTracker</a> to allow progress reporting and cancelleation for the write operation. </td></tr>
    <tr><td class="paramname">error</td><td>An out NSError parameter. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>YES if the write succeeded, NO if it failed. </dd></dl>

<p>Extends class <a class="el" href="interface_h_f_byte_array.html#a9be82f7cd32f941cc94d1843ad9ad5e8">HFByteArray</a>.</p>

</div>
</div>
<a id="a44e1ab1943523b12bfd2e423ec87274a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a44e1ab1943523b12bfd2e423ec87274a">&sect;&nbsp;</a></span>rangesOfFileModifiedIfSavedToFile:()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (NSArray *) rangesOfFileModifiedIfSavedToFile: </td>
          <td></td>
          <td class="paramtype">(<a class="el" href="interface_h_f_file_reference.html">HFFileReference</a> *)&#160;</td>
          <td class="paramname"><em>reference</em></td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns the ranges of the file that would be modified, if the receiver were written to it. This is useful (for example) in determining if the clipboard can be preserved after a save operation. This is a concrete method on <a class="el" href="interface_h_f_byte_array.html" title="The principal Model class for HexFiend&#39;s MVC architecture. ">HFByteArray</a>. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">reference</td><td>An <a class="el" href="interface_h_f_file_reference.html" title="A reference to an open file. ">HFFileReference</a> to the file to be modified </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>An array of <a class="el" href="interface_h_f_range_wrapper.html">HFRangeWrappers</a>, representing the ranges of the file that would be affected. If no range would be affected, the result is an empty array. </dd></dl>

<p>Extends class <a class="el" href="interface_h_f_byte_array.html#a44e1ab1943523b12bfd2e423ec87274a">HFByteArray</a>.</p>

</div>
</div>
<a id="a7ea74a3d609086f0ece0998ff96947e9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7ea74a3d609086f0ece0998ff96947e9">&sect;&nbsp;</a></span>clearDependenciesOnRanges:inFile:hint:()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (BOOL) clearDependenciesOnRanges: </td>
          <td></td>
          <td class="paramtype">(NSArray *)&#160;</td>
          <td class="paramname"><em>ranges</em></td>
        </tr>
        <tr>
          <td class="paramkey">inFile:</td>
          <td></td>
          <td class="paramtype">(<a class="el" href="interface_h_f_file_reference.html">HFFileReference</a> *)&#160;</td>
          <td class="paramname"><em>reference</em></td>
        </tr>
        <tr>
          <td class="paramkey">hint:</td>
          <td></td>
          <td class="paramtype">(NSMutableDictionary *)&#160;</td>
          <td class="paramname"><em>hint</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Attempts to modify the receiver so that it no longer depends on any of the HFRanges in the array within the given file. It is not necessary to perform this operation on the byte array that is being written to the file. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ranges</td><td>An array of HFRangeWrappers, representing ranges in the given file that the receiver should no longer depend on. </td></tr>
    <tr><td class="paramname">reference</td><td>The <a class="el" href="interface_h_f_file_reference.html" title="A reference to an open file. ">HFFileReference</a> that the receiver should no longer depend on. </td></tr>
    <tr><td class="paramname">hint</td><td>A dictionary that can be used to improve the efficiency of the operation, by allowing multiple byte arrays to share the same state. If you plan to call this method on multiple byte arrays, pass the first one an empty NSMutableDictionary, and pass the same dictionary to subsequent calls. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A YES return indicates the operation was successful, and the receiver no longer contains byte slices that source data from any of the ranges of the given file (or never did). A NO return indicates that breaking the dependencies would require too much memory, and so the receiver still depends on some of those ranges. </dd></dl>

<p>Extends class <a class="el" href="interface_h_f_byte_array.html#a7ea74a3d609086f0ece0998ff96947e9">HFByteArray</a>.</p>

</div>
</div>
<hr/>The documentation for this category was generated from the following file:<ul>
<li><a class="el" href="_h_f_byte_array_8h_source.html">HFByteArray.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.12
</small></address>
</body>
</html>
